<template>
  <div>
    <el-card>
      <span>我的租赁如下</span>
      <!--      表格-->

      <el-table :data="queryList" border stripe :default-sort="{prop: 'timestamp', order: 'descending'}">
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column label="设备名" prop="name"></el-table-column>
        <el-table-column label="设备编号" prop="eqNo"></el-table-column>
        <el-table-column label="租赁数量" prop="count"></el-table-column>
        <el-table-column label="总花费" prop="cost"></el-table-column>
        <el-table-column label="租赁时间" prop="timestamp" min-width="112px" sortable></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>

export default {
  name: "myRent",
  mounted() {
    this.query();
  },
  data() {
    return {
      queryList: []
    }


  },
  methods: {
    query() {
      this.$http.get("/user/eqrent").then(res => {
        if (res.data.code === 200) {
          this.queryList = res.data.data
          return;
        }
        this.$message.error("查询失败")
      }).catch(err => {
      })
    }

  }
}
</script>

<style scoped>

span {
  margin-left: 500px;
  font-size: 30px;
  color: #FF8000;
}

</style>
